package com.liz.lizrpccore.configs;

import com.liz.lizrpccore.entity.RemoteInvokeEntity;

/**
 * @author liangGongWei
 * @description
 * @create 2021-08-25 20:32
 **/

public class RpcRedisConst {

    /**
     * 冒号
     */
    public static final String COLON = ":";


    /**
     * 保存请求信息
     */
    public static final String REQUEST_SIDE_REDIS_KEY = "liz-rpc:request:";

    /**
     * 保存结果信息
     */
    public static final String RESULT_SIDE_REDIS_KEY = "liz-rpc:result:";

    /**
     * 获得 request 请求保存位置的key
     *
     * @param className
     */
    public static String getSaveRequestRedisKey(final String className) {
        return RpcRedisConst.REQUEST_SIDE_REDIS_KEY + className;
    }

    /**
     * 获得 result 请求保存位置的key
     * @param className
     * @param clientId
     * @param requestId
     */
    public static String getSaveResultToRemoteRedisKey(String className, String clientId,String requestId) {
        return RpcRedisConst.RESULT_SIDE_REDIS_KEY + className + RpcRedisConst.COLON + clientId + RpcRedisConst.COLON + requestId;
    }
}
